package com.account.validate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class LoginValidator {

	private Pattern pattern;
	private Matcher matcher;

	private static final String USERNAME_PATTERN = "^[a-z0-9_-]{3,15}$";
	
	
	public LoginValidator() {
		pattern = Pattern.compile(USERNAME_PATTERN);
		
	}

	public boolean isValidate(final String username) {

		matcher = pattern.matcher(username);
		return matcher.matches();

	}
	public boolean isPassword(String password ){
		int length=password.length();
		boolean result=true;
		if (length>=7) {
			result=true;
		} else {
       result=false;
		}
		return result;
	}

}